import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tot_android_flutter/base/BaseController.dart';
import 'package:tot_android_flutter/base/BasePageController.dart';
import 'package:tot_android_flutter/eneity/AppResponse.dart';
import 'package:tot_android_flutter/eneity/project_category_entity.dart';
import 'package:tot_android_flutter/eneity/project_list_entity.dart';
import 'package:tot_android_flutter/utils/log_util.dart';

class ProjectController extends BaseController
    with GetSingleTickerProviderStateMixin {
  var projectCategorys = <ProjectCategoryEntity>[].obs; // 假设BannerData是横幅数据的模型
  TabController? tabController;

  void requestProjectCategory() {
    sendRequest(apiService.projectCategory(), bindViewState: true,
        successCallback: (data) {
      tabController ??= TabController(vsync: this, length: data.length);
      WanLog.d("guoyh-tabController Init}");
      projectCategorys.assignAll(data);
    });
  }

  @override
  void loadData() {
    requestProjectCategory();
  }

  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onClose() {
    tabController?.dispose();
    super.onClose();
  }
}
